package com.landary.parameterrplacement.entity;

import lombok.*;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author 刘欣
 * @createTime 2023/8/1 8:56
 * @description
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class AvicOrg {
    private String ou;
    private String avicDeptName;
    private String avicParentDeptCode;
    private String avicParentDeptName;
    private String avicDeptState;
    private String avicShowCode;

    public static List<AvicOrg> mapToUserList(List<Map<String, String>> mapList) {
        ArrayList<AvicOrg> avicOrgList = new ArrayList<>();
        for (Map<String, String> map : mapList) {
            AvicOrg avicOrg = new AvicOrg();

            avicOrg.setOu(map.get("ou"));
            avicOrg.setAvicDeptName(map.get("avicDeptName"));
            avicOrg.setAvicParentDeptCode(map.get("avicParentDeptCode"));
            avicOrg.setAvicParentDeptName(map.get("avicParentDeptName"));
            avicOrg.setAvicDeptState(map.get("avicDeptState"));
            avicOrg.setAvicShowCode(map.get("avicShowCode"));
            avicOrgList.add(avicOrg);
        }
        return avicOrgList;
    }
}
